package com.polymorphic多态.polyArray多态数组;

public class Teacher extends Person{
    private double salary;

    public Teacher(String name, int age, double salary) {
        super(name, age);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public String say() {
        return "教师 " + super.say() + " salary = " + salary;
    }

    public void teach(){
        System.out.println("老师 " + getName() + " 在教学");
    }
}
